home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Apple Game Sprockets / More Sprocket Examples 1.0 / GlyphaIV Sources / G4Prefs.c < prev    next >
Encoding:
Text File  |  1996-06-12  |  18.3 KB  |  526 lines  |  [TEXT/CWIE]

  1.  
  2. //============================================================================
  3. //----------------------------------------------------------------------------
  4. //                                    Prefs.c
  5. //----------------------------------------------------------------------------
  6. //============================================================================
  7.  
  8. // This is a slick little file that I re-use and re-use.  I wrote it to…
  9. // seemlessly handle System 6 or System 7 with but a single call.  You need…
  10. // to define your own "prefs" struct, but these routines will read and write…
  11. // it to the System folder.
  12.  
  13. #include "G4Externs.h"
  14. #include <Folders.h>                            // Needed for creating a folder.
  15. #include <GestaltEqu.h>                            // Needed for the Gestalt() call.
  16. #include <Script.h>                                // I can't remember why I needed this.
  17. #include <ToolUtils.h>
  18. #include <TextUtils.h>
  19.  
  20.  
  21. #define    kPrefCreatorType    'zade'                // Change this to reflect your apps creator.
  22. #define    kPrefFileType        'zadP'                // Change this to reflect your prefs type.
  23. #define    kPrefFileName        "\pGlypha Prefs"    // Change this to reflect the name for your prefs.
  24. #define    kDefaultPrefFName    "\pPreferences"        // Name of prefs folder (System 6 only).
  25. #define kPrefsStringsID        160                    // For easy localization.
  26. #define    kPrefsFNameIndex    1                    // This one works with the previous constant.
  27.  
  28.  
  29. Boolean CanUseFindFolder (void);
  30. Boolean GetPrefsFPath (long *, short *);
  31. Boolean CreatePrefsFolder (short *);
  32. Boolean GetPrefsFPath6 (short *);
  33. Boolean WritePrefs (long *, short *, prefsInfo *);
  34. Boolean WritePrefs6 (short *, prefsInfo *);
  35. OSErr ReadPrefs (long *, short *, prefsInfo *);
  36. OSErr ReadPrefs6 (short *, prefsInfo *);
  37. Boolean DeletePrefs (long *, short *);
  38. Boolean DeletePrefs6 (short *);
  39.  
  40.  
  41. //==============================================================  Functions
  42. //--------------------------------------------------------------  CanUseFindFolder
  43.  
  44. // Returns TRUE if we can use the FindFolder() call (a System 7 nicety).
  45.  
  46. Boolean CanUseFindFolder (void)
  47. {
  48.     OSErr        theErr;
  49.     long        theFeature;
  50.     
  51.     if (!DoWeHaveGestalt())        // Darn, have to check for Gestalt() first.
  52.         return(FALSE);            // If no Gestalt(), probably don't have FindFolder().
  53.     
  54.     theErr = Gestalt(gestaltFindFolderAttr, &theFeature);
  55.     if (theErr != noErr)        // Use selector for FindFolder() attribute.
  56.         return(FALSE);
  57.                                 // Now do a bit test specifically for FindFolder().
  58.     if (!BitTst(&theFeature, 31 - gestaltFindFolderPresent))
  59.         return(FALSE);
  60.     else
  61.         return(TRUE);
  62. }
  63.  
  64. //--------------------------------------------------------------  GetPrefsFPath
  65.  
  66. // This function gets the file path to the Preferences folder (for System 7).
  67. // It is called only if we can use FindFolder() (see previous function).
  68.  
  69. Boolean GetPrefsFPath (long *prefDirID, short *systemVolRef)
  70. {
  71.     OSErr        theErr;
  72.                                     // Here's the wiley FindFolder() call.
  73.     theErr = FindFolder(kOnSystemDisk, kPreferencesFolderType, kCreateFolder, 
  74.         systemVolRef, prefDirID);    // It returns to us the directory and volume ref.…
  75.     if (theErr != noErr)            // Assuming it worked at all!
  76.         return(FALSE);
  77.     
  78.     return(TRUE);
  79. }
  80.  
  81. //--------------------------------------------------------------  CreatePrefsFolder
  82.  
  83. // This function won't be necessary for System 7, for System 6 though, it creates…
  84. // a folder ("Preferences") in the System folder and returns whether or not it worked.
  85.  
  86. Boolean CreatePrefsFolder (short *systemVolRef)
  87. {
  88.     HFileParam    fileParamBlock;
  89.     Str255        folderName;
  90.     OSErr        theErr;
  91.                                         // Here's our localization.  Rather than…
  92.                                         // hard-code the name "Preferences" in the code…
  93.                                         // we pull up the text from a string resource.
  94.     GetIndString(folderName, kPrefsStringsID, kPrefsFNameIndex);
  95.                                         // Set up a file parameter block.
  96.     fileParamBlock.ioVRefNum = *systemVolRef;
  97.     fileParamBlock.ioDirID = 0;
  98.     fileParamBlock.ioNamePtr = folderName;
  99.     fileParamBlock.ioCompletion = 0L;
  100.                                         // And create a directory (folder).
  101.     theErr = PBDirCreate((HParmBlkPtr)&fileParamBlock, FALSE);
  102.     if (theErr != noErr)                // See that it worked.
  103.     {
  104.         RedAlert("\pPrefs Creation Error");
  105.         return(FALSE);
  106.     }
  107.     return(TRUE);
  108. }
  109.  
  110. //--------------------------------------------------------------  GetPrefsFPath6
  111.  
  112. // If ever there was a case to drop support for System 6 (and require System 7),…
  113. // this is it.  Look at how insidious handling System 6 files can be.  The following…
  114. // function is the "System 6 pedigree" of the above GetPrefsFPath() function.  Note…
  115. // that the GetPrefsFPath() function was ONE CALL!  TWO LINES OF CODE!  The below…
  116. // function is like a page or so.  Anyway, this function is called if Glypha is…
  117. // running under System 6 and essentially returns a volume reference pointing to…
  118. // the preferences folder.
  119.  
  120. Boolean GetPrefsFPath6 (short *systemVolRef)
  121. {
  122.     Str255        folderName, whoCares;
  123.     SysEnvRec    thisWorld;
  124.     CInfoPBRec    catalogInfoPB;
  125.     DirInfo        *directoryInfo = (DirInfo *) &catalogInfoPB;
  126.     HFileInfo    *fileInfo = (HFileInfo *) &catalogInfoPB;
  127.     WDPBRec        workingDirPB;
  128.     long        prefDirID;
  129.     OSErr        theErr;
  130.                                                 // Yokelization.
  131.     GetIndString(folderName, kPrefsStringsID, kPrefsFNameIndex);
  132.                                                 // SysEnvirons() for System folder volRef.
  133.     theErr = SysEnvirons(2, &thisWorld);
  134.     if (theErr != noErr)
  135.         return(FALSE);
  136.                                                 // Okay, here's the volume reference.
  137.     *systemVolRef = thisWorld.sysVRefNum;
  138.     fileInfo->ioVRefNum = *systemVolRef;        // Set up another parameter block.
  139.     fileInfo->ioDirID  = 0;                        // Ignored.
  140.     fileInfo->ioFDirIndex = 0;                    // Irrelevant.
  141.     fileInfo->ioNamePtr = folderName;            // Directory we're looking for.
  142.     fileInfo->ioCompletion = 0L;
  143.     theErr = PBGetCatInfo(&catalogInfoPB, FALSE);
  144.     if (theErr != noErr)                        // Did we fail to find Prefs folder?
  145.     {
  146.         if (theErr != fnfErr)                    // If it WASN'T a file not found error…
  147.         {                                        // then something more sinister is afoot.
  148.             RedAlert("\pPrefs Filepath Error");
  149.         }                                        // Otherwise, need to create prefs folder.
  150.         if (!CreatePrefsFolder(systemVolRef))
  151.             return(FALSE);
  152.                                                 // Again - can we find the prefs folder?
  153.         directoryInfo->ioVRefNum = *systemVolRef;
  154.         directoryInfo->ioFDirIndex = 0;
  155.         directoryInfo->ioNamePtr = folderName;
  156.         theErr = PBGetCatInfo(&catalogInfoPB, FALSE);
  157.         if (theErr != noErr)
  158.         {
  159.             RedAlert("\pPrefs GetCatInfo() Error");
  160.             return(FALSE);
  161.         }
  162.     }
  163.     prefDirID = directoryInfo->ioDrDirID;        // Alright, the dir. ID for prefs folder.
  164.     
  165.     workingDirPB.ioNamePtr = whoCares;            // Now convert working dir. into a "real"…
  166.     workingDirPB.ioVRefNum = *systemVolRef;        // dir. ID so we can get volume number.
  167.     workingDirPB.ioWDIndex = 0;
  168.     workingDirPB.ioWDProcID = 0;
  169.     workingDirPB.ioWDVRefNum = 0;
  170.     workingDirPB.ioCompletion = 0L;
  171.     theErr = PBGetWDInfo(&workingDirPB, FALSE);
  172.     if (theErr != noErr)
  173.     {
  174.         RedAlert("\pPrefs PBGetWDInfo() Error");
  175.     }
  176.                                                 // The volume where directory is located.
  177.     *systemVolRef = workingDirPB.ioWDVRefNum;
  178.     
  179.     workingDirPB.ioNamePtr = whoCares;
  180.     workingDirPB.ioWDDirID = prefDirID;            // Okay, finally, with a directory ID, …
  181.     workingDirPB.ioVRefNum = *systemVolRef;        // and a "hard" volume number…
  182.     workingDirPB.ioWDProcID = 0;                // …
  183.     workingDirPB.ioCompletion = 0L;                // …
  184.     theErr = PBOpenWD(&workingDirPB, FALSE);    // we can create a working directory…
  185.     if (theErr != noErr)                        // control block with which to access…
  186.     {                                            // files in the prefs folder.
  187.         RedAlert("\pPrefs PBOpenWD() Error");
  188.     }
  189.     
  190.     *systemVolRef = workingDirPB.ioVRefNum;
  191.     
  192.     return(TRUE);
  193. }
  194.  
  195. //--------------------------------------------------------------  WritePrefs
  196.  
  197. // This is the System 7 version that handles all the above functions when you…
  198. // want to write out the preferences file.  It is called by SavePrefs() below…
  199. // if we're running under System 7.  It creates an FSSpec record to hold…
  200. // information about where the preferences file is located, creates Glypha's…
  201. // preferences if they are not found, opens the prefences file, writes out…
  202. // the preferences, and the closes the prefs.  Bam, bam, bam.
  203.  
  204. Boolean WritePrefs (long *prefDirID, short *systemVolRef, prefsInfo *thePrefs)
  205. {
  206.     OSErr        theErr;
  207.     short        fileRefNum;
  208.     long        byteCount;
  209.     FSSpec        theSpecs;
  210.     Str255        fileName = kPrefFileName;
  211.                                     // Create FSSpec record from volume ref and dir ID.
  212.     theErr = FSMakeFSSpec(*systemVolRef, *prefDirID, fileName, &theSpecs);
  213.     if (theErr != noErr)            // See if it failed.
  214.     {                                // An fnfErr means file not found error (no prefs).
  215.         if (theErr != fnfErr)        // If that weren't the problem, we're cooked.
  216.             RedAlert("\pPrefs FSMakeFSSpec() Error");
  217.                                     // If it was an fnfErr, create the prefs.
  218.         theErr = FSpCreate(&theSpecs, kPrefCreatorType, kPrefFileType, smSystemScript);
  219.         if (theErr != noErr)        // If we fail to create the prefs, bail.
  220.             RedAlert("\pPrefs FSpCreate() Error");
  221.     }                                // Okay, we either found or made a pref file, open it.
  222.     theErr = FSpOpenDF(&theSpecs, fsRdWrPerm, &fileRefNum);
  223.     if (theErr != noErr)            // As per usual, if we fail, bail.
  224.         RedAlert("\pPrefs FSpOpenDF() Error");
  225.     
  226.     byteCount = sizeof(*thePrefs);    // Get number of bytes to write (your prefs struct).
  227.                                     // And, write out the preferences.
  228.     theErr = FSWrite(fileRefNum, &byteCount, thePrefs);
  229.     if (theErr != noErr)            // Say no more.
  230.         RedAlert("\pPrefs FSWrite() Error");
  231.     
  232.     theErr = FSClose(fileRefNum);    // Close the prefs file.
  233.     if (theErr != noErr)            // Tic, tic.
  234.         RedAlert("\pPrefs FSClose() Error");
  235.     
  236.     return(TRUE);
  237. }
  238.  
  239. //--------------------------------------------------------------  WritePrefs6
  240.  
  241. // This is the System 6 equivalent of the above function.  It handles prefs…
  242. // opening, writing and closing for System 6.
  243.  
  244. Boolean WritePrefs6 (short *systemVolRef, prefsInfo *thePrefs)
  245. {
  246.     OSErr        theErr;
  247.     short        fileRefNum;
  248.     long        byteCount;
  249.     Str255        fileName = kPrefFileName;
  250.                                     // Attempt to open prefs file.
  251.     theErr = FSOpen(fileName, *systemVolRef, &fileRefNum);
  252.     if (theErr != noErr)            // If it failed, maybe the prefs don't exist.
  253.     {                                // An fnfErr means file not found.
  254.         if (theErr != fnfErr)        // See if in fact that WASN'T the reason.
  255.             RedAlert("\pPrefs FSOpen() Error");
  256.                                     // If fnfErr WAS the problem, create the prefs.
  257.         theErr = Create(fileName, *systemVolRef, kPrefCreatorType, kPrefFileType);
  258.         if (theErr != noErr)
  259.             RedAlert("\pPrefs Create() Error");
  260.                                     // Open the prefs file.
  261.         theErr = FSOpen(fileName, *systemVolRef, &fileRefNum);
  262.         if (theErr != noErr)
  263.             RedAlert("\pPrefs FSOpen() Error");
  264.     }
  265.     
  266.     byteCount = sizeof(*thePrefs);    // Get number of bytes to write out.
  267.                                     // Write the prefs out.
  268.     theErr = FSWrite(fileRefNum, &byteCount, thePrefs);
  269.     if (theErr != noErr)
  270.         RedAlert("\pPrefs FSWrite() Error");
  271.                                     // And close the prefs file.
  272.     theErr = FSClose(fileRefNum);
  273.     if (theErr != noErr)
  274.         RedAlert("\pPrefs FSClose() Error");
  275.     
  276.     return(TRUE);
  277. }
  278.  
  279. //--------------------------------------------------------------  SavePrefs
  280.  
  281. // This is the single function called externally to save the preferences.
  282. // You pass it a pointer to your preferences struct and a version number.
  283. // One of the fields in your preferences struct should be a version number…
  284. // (short prefVersion).  This function determines if we're on System 6 or 7…
  285. // and then calls the appropriate routines.  It returns TRUE if all went well…
  286. // or FALSE if any step failed.
  287.  
  288. Boolean SavePrefs (prefsInfo *thePrefs, short versionNow)
  289. {
  290.     long        prefDirID;
  291.     short        systemVolRef;
  292.     Boolean        canUseFSSpecs;
  293.     
  294.     thePrefs->prefVersion = versionNow;            // Set prefVersion to versionNow.
  295.     
  296.     canUseFSSpecs = CanUseFindFolder();            // See if we can use FindFolder().
  297.     if (canUseFSSpecs)                            // If so (System 7) take this route.
  298.     {                                            // Get a path to Preferences folder.
  299.         if (!GetPrefsFPath(&prefDirID, &systemVolRef))
  300.             return(FALSE);
  301.     }
  302.     else                                        // Here's the System 6 version.
  303.     {
  304.         if (!GetPrefsFPath6(&systemVolRef))
  305.             return(FALSE);
  306.     }
  307.     
  308.     if (canUseFSSpecs)                            // Write out the preferences.
  309.     {
  310.         if (!WritePrefs(&prefDirID, &systemVolRef, thePrefs))
  311.             return(FALSE);
  312.     }
  313.     else
  314.     {
  315.         if (!WritePrefs6(&systemVolRef, thePrefs))
  316.             return(FALSE);
  317.     }
  318.     
  319.     return(TRUE);
  320. }
  321.  
  322. //--------------------------------------------------------------  ReadPrefs
  323.  
  324. // This is the System 7 version for reading in the preferences.  It handles…
  325. // opening the prefs, reading in the data to your prefs struct and closing…
  326. // the file.
  327.  
  328. OSErr ReadPrefs (long *prefDirID, short *systemVolRef, prefsInfo *thePrefs)
  329. {
  330.     OSErr        theErr;
  331.     short        fileRefNum;
  332.     long        byteCount;
  333.     FSSpec        theSpecs;
  334.     Str255        fileName = kPrefFileName;
  335.                                     // Get an FSSpec record to the prefs file.
  336.     theErr = FSMakeFSSpec(*systemVolRef, *prefDirID, fileName, &theSpecs);
  337.     if (theErr != noErr)
  338.     {
  339.         if (theErr == fnfErr)        // If it doesn't exist, return - we'll use defaults.
  340.             return(theErr);
  341.         else                        // If some other file error occured, bail.
  342.             RedAlert("\pPrefs FSMakeFSSpec() Error");
  343.     }
  344.                                     // Open the prefs file.
  345.     theErr = FSpOpenDF(&theSpecs, fsRdWrPerm, &fileRefNum);
  346.     if (theErr != noErr)
  347.         RedAlert("\pPrefs FSpOpenDF() Error");
  348.     
  349.     byteCount = sizeof(*thePrefs);    // Determine the number of bytes to read in.
  350.                                     // Read 'em into your prefs struct.
  351.     theErr = FSRead(fileRefNum, &byteCount, thePrefs);
  352.     if (theErr != noErr)            // If there was an error reading the file…
  353.     {                                // close the file and we'll revert to defaults.
  354.         if (theErr == eofErr)
  355.             theErr = FSClose(fileRefNum);
  356.         else                        // If closing failed, bail.
  357.             RedAlert("\pPrefs FSRead() Error");
  358.         return(theErr);
  359.     }
  360.     
  361.     theErr = FSClose(fileRefNum);    // Close the prefs file.
  362.     if (theErr != noErr)
  363.         RedAlert("\pPrefs FSClose() Error");
  364.     
  365.     return(theErr);
  366. }
  367.  
  368. //--------------------------------------------------------------  ReadPrefs6
  369.  
  370. // This is the System 6 version of the above function.  It's basically the same,…
  371. // but doesn't have the luxury of using FSSpec records.
  372.  
  373. OSErr ReadPrefs6 (short *systemVolRef, prefsInfo *thePrefs)
  374. {
  375.     OSErr        theErr;
  376.     short        fileRefNum;
  377.     long        byteCount;
  378.     Str255        fileName = kPrefFileName;
  379.                                 // Attempt to open the prefs file.
  380.     theErr = FSOpen(fileName, *systemVolRef, &fileRefNum);
  381.     if (theErr != noErr)        // Did opening the file fail?
  382.     {
  383.         if (theErr == fnfErr)    // It did - did it fail because it doesn't exist?
  384.             return(theErr);        // Okay, then we'll revert to default settings.
  385.         else                    // Otherwise, we have a more serious problem.
  386.             RedAlert("\pPrefs FSOpen() Error");
  387.     }
  388.                                 // Get number of bytes to read in.
  389.     byteCount = sizeof(*thePrefs);
  390.                                 // Read in the stream of data into prefs struct.
  391.     theErr = FSRead(fileRefNum, &byteCount, thePrefs);
  392.     if (theErr != noErr)        // Did the read fail?
  393.     {                            // Maybe we're reading too much data (new prefs vers).
  394.         if (theErr == eofErr)    // That's okay, we'll use defaults for now.
  395.             theErr = FSClose(fileRefNum);
  396.         else
  397.             RedAlert("\pPrefs FSRead() Error");
  398.         return(theErr);
  399.     }
  400.                                 // Close the prefs file.
  401.     theErr = FSClose(fileRefNum);
  402.     if (theErr != noErr)
  403.         RedAlert("\pPrefs FSClose() Error");
  404.     
  405.     return(theErr);
  406. }
  407.  
  408. //--------------------------------------------------------------  DeletePrefs
  409.  
  410. // It can happen that you introduce a game with only a few preference settings…
  411. // but then later update your game and end up having to add additional settings…
  412. // to be stored in your games preferences.  In this case, the size of the old…
  413. // prefs won't match the size of the new.  Or even if the size is the same, you…
  414. // may have re-ordered the prefs and attempting to load the old prefs will result…
  415. // in garbage.  It is for this reason that I use the "versionNeed" variable and…
  416. // the "prefVersion" field in the prefs struct.  In such a case, the below function…
  417. // will be called to delte the old prefs.  When the prefs are then written out, a…
  418. // new pref file will be created.  This particular function is the System 7 version…
  419. // for deleting the old preferences.
  420.  
  421. Boolean DeletePrefs (long *dirID, short *volRef)
  422. {
  423.     FSSpec        theSpecs;
  424.     Str255        fileName = kPrefFileName;
  425.     OSErr        theErr;
  426.                                             // Create an FSSec record.
  427.     theErr = FSMakeFSSpec(*volRef, *dirID, fileName, &theSpecs);
  428.     if (theErr != noErr)                    // Test to see if it worked.
  429.         return(FALSE);
  430.     else                                    // If it worked…
  431.         theErr = FSpDelete(&theSpecs);        // delete the file.
  432.     
  433.     if (theErr != noErr)
  434.         return(FALSE);
  435.     
  436.     return(TRUE);
  437. }
  438.  
  439. //--------------------------------------------------------------  DeletePrefs6
  440.  
  441. // This is the System 6 version for deleting a preferences file (see above function).
  442.  
  443. Boolean DeletePrefs6 (short *volRef)
  444. {
  445.     Str255        fileName = kPrefFileName;
  446.     OSErr        theErr;
  447.     
  448.     theErr = FSDelete(fileName, *volRef);    // Delete the prefs file.
  449.     
  450.     if (theErr != noErr)
  451.         return(FALSE);
  452.     
  453.     return(TRUE);
  454. }
  455.  
  456. //--------------------------------------------------------------  LoadPrefs
  457.  
  458. // Here is the single call for loading in preferences.  It handles all the…
  459. // above function onvolved with opening and reading in preferences.  It…
  460. // determines whether we are on System 6 or 7 (FSSpecs) and makes the right…
  461. // calls.
  462.  
  463. Boolean LoadPrefs (prefsInfo *thePrefs, short versionNeed)
  464. {
  465.     long        prefDirID;
  466.     OSErr        theErr;
  467.     short        systemVolRef;
  468.     Boolean        canUseFSSpecs, noProblems;
  469.     
  470.     canUseFSSpecs = CanUseFindFolder();    // See if we can use FSSpecs (System 7).
  471.     if (canUseFSSpecs)
  472.     {                                    // Get a path to the prefs file.
  473.         noProblems = GetPrefsFPath(&prefDirID, &systemVolRef);
  474.         if (!noProblems)
  475.             return(FALSE);
  476.     }
  477.     else
  478.     {                                    // Gets path to prefs file (System 6).
  479.         noProblems = GetPrefsFPath6(&systemVolRef);
  480.         if (!noProblems)
  481.             return(FALSE);
  482.     }
  483.     
  484.     if (canUseFSSpecs)
  485.     {                                    // Attempt to read prefs.
  486.         theErr = ReadPrefs(&prefDirID, &systemVolRef, thePrefs);
  487.         if (theErr == eofErr)            // Fail the read?  Maybe an old prefs version.
  488.         {                                // Delete it - we'll create a new one later.
  489.             noProblems = DeletePrefs(&prefDirID, &systemVolRef);
  490.             return(FALSE);                // Meanwhile, we'll use defaults.
  491.         }
  492.         else if (theErr != noErr)
  493.             return(FALSE);
  494.     }
  495.     else
  496.     {                                    // Attempt to read prefs (System 6).
  497.         theErr = ReadPrefs6(&systemVolRef, thePrefs);
  498.         if (theErr == eofErr)            // Fail the read?  Maybe an old prefs version.
  499.         {                                // Delete it - we'll create a new one later.
  500.             noProblems = DeletePrefs6(&systemVolRef);
  501.             return(FALSE);                // Meanwhile, we'll use defaults.
  502.         }
  503.         else if (theErr != noErr)
  504.             return(FALSE);
  505.     }
  506.                                         // Okay, maybe the read worked, but we still…
  507.                                         // need to check the version number to see…
  508.                                         // if it's current.
  509.     if (thePrefs->prefVersion != versionNeed)
  510.     {                                    // We'll delete the file if old version.
  511.         if (canUseFSSpecs)
  512.         {
  513.             noProblems = DeletePrefs(&prefDirID, &systemVolRef);
  514.             return(FALSE);
  515.         }
  516.         else
  517.         {
  518.             noProblems = DeletePrefs6(&systemVolRef);
  519.             return(FALSE);
  520.         }
  521.     }
  522.     
  523.     return(TRUE);
  524. }
  525.  
  526.